package hipt.com.service.serviceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import hipt.com.dao.CategoryDao;
import hipt.com.model.Category;
import hipt.com.service.CategoryService;

@Service("categoryService")
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
public class CategoryServiceImpl implements CategoryService {
	@Autowired
	private CategoryDao categoryDao;

	@Override
	public void deleteCategory(Category category) {
		categoryDao.deleteCategory(category);
	}

	@Override
	public Category getCategoryById(Integer id) {
		return categoryDao.getCategoryById(id);
	}

	@Override
	public List<Category> listCategories() {
		return categoryDao.listCategories();
	}

	@Override
	public void saveCategory(Category category) {
		categoryDao.saveCategory(category);
		
	}

	@Override
	public void updateCategory(Category category) {
		categoryDao.updateCategory(category);
	}

}
